#ifndef __BUDDY_H_
#define __BUDDY_H_

#include <types.h>

struct buddy_class
{
     void* (*top_level_alloc) (uint32 size);
     void (*top_level_free_s) (void* addr, uint32 size);
     void* (*alloc) (uint32 size);
     void (*free_s) (void* address, uint32 size);
     struct buddy_bucket* bucket; /* bucket entry */
     uint32 bucket_total;		/* total item */
     
};

struct buddy_bucket
{
     uint16 size;
     uint16 number;     
     struct buddy_slinked_list* next;
};

struct buddy_slinked_list
{
     struct buddy_slinked_list* next;
};

void* buddy_alloc(struct buddy_class* buddy_class, uint32 size);
void buddy_free_s(struct buddy_class* buddy_class, void* addr, uint32 size);
void buddy_bucket_dump(struct buddy_bucket* bucket, uint32 len);

#endif 
